import React, { lazy } from 'react';
import { RouterRawState } from '../types';
import Layout from '../layout'
import NotPromission from '../views/403';
import NotFound from '../views/404';
const Home = lazy(() => import('../views/home'))
const ListAdd = lazy(() => import('../views/listAdd'))
const ListManage = lazy(() => import('../views/listManage'))
const Login = lazy(() => import('../views/login'))
const MyInfo = lazy(() => import('../views/myInfo'))
const Regist = lazy(() => import('../views/regist'))
const UserManage = lazy(() => import('../views/userManage'))
const notFound = lazy(() => import('../views/404'))
const notPromisstion = lazy(() => import('../views/403'))

export const static_routes: RouterRawState[] = [{
  path: '/',
  element: <Layout><Home></Home></Layout>,
  meta: {
    label: '首页'
  }
}, {
  path: '/list',
  meta: {
    label: '列表操作'
  },
  children: [{
    path: '/list/add',
    element: <Layout><ListAdd></ListAdd></Layout>,
    meta: {
      label: '列表添加'
    }
  }, {
    path: '/list/manage',
    element:
      <Layout>
        <ListManage></ListManage>
      </Layout>,
    meta: {
      label: '列表管理'
    }
  }, {
    path: '/list/qwer',
    meta: {
      label: '列表三级'
    },
    children: [{
      path: '/list/qwer/asdf',
      element: <Layout>列表四级1 内容</Layout>,
      meta: {
        label: '列表四级1'
      }
    }, {
      path: '/list/qwer/asdf123',
      element: <Layout>列表四级2 内容</Layout>,
      meta: {
        label: '列表四级2'
      }
    }]
  }]
}, {
  path: '/login',
  element: <Login />,
  meta: {
    label: '登录',
    hidden: true
  }
}, {
  path: '/my/info',
  element: <Layout><MyInfo></MyInfo></Layout>,
  meta: {
    label: '我的信息'
  }
}, {
  path: '/regist',
  element: <Regist />,
  meta: {
    label: '注册',
    hidden: true
  }
}, {
  path: '/user/manage',
  element: <Layout><UserManage></UserManage></Layout>,
  meta: {
    label: '用户管理',
    roles: ['admin']
  }
}, {
  path: '/403',
  element: <Layout><NotPromission></NotPromission></Layout>,
  meta: {
    label: '无权限',
    hidden: true
  }
}, {
  path: '*',
  element: <Layout><NotFound></NotFound></Layout>,
  meta: {
    label: '未找到',
    hidden: true
  }
}]
